﻿var gLocalSearch;
var gInfoWindow;
var gSelectedResults = [];
var gCurrentResults = [];

function doSearch() {
      var query = document.getElementById("txtSearch").value;
      gLocalSearch.setCenterPoint(map.getCenter());
      gLocalSearch.execute(query);
}
function OnLocalSearch() {
  if (!gLocalSearch.results) return;

      // Move the map to the first result
      var first = gLocalSearch.results[0];
      
      map.setCenter(new google.maps.LatLng(parseFloat(first.lat),
                                            parseFloat(first.lng)));
     var markerresult = new google.maps.Marker({
        position: new google.maps.LatLng(parseFloat(first.lat),
                                         parseFloat(first.lng)),
       map: map
       });

 }
     